
<div id="profile_header">
  <div class="profile-pic">
<?php
	if ($this->pageName) {
		$imgDims = 'width="64" height="64"';
	} else {
		$imgDims = 'width="96" height="96"';
	}
?>
    <img src="<?php echo $this->entityAvatarUrl; ?>" alt="<?php echo $this->escape($this->entityNicename); ?>"
      title="<?php echo $this->escape($this->entityNicename); ?>" <?php echo $imgDims; ?> />
  </div>
  <div id="profile_block">
  <div id="profile_title"><?php echo $this->escape($this->entityNicename); ?></div>
<?php if (empty($this->entityStatus) === FALSE): ?>
  <div class="entity_status contrast_m"><?php echo $this->escape($this->entityStatus); ?></div>
<?php endif; ?>
<?php if (empty($this->entityRelationshipUrl) === FALSE): ?>
  <div class="entity_relationship"><?php echo $this->entityRelationshipUrl; ?></div>
<?php endif; ?>
  </div>
<div class="clear"></div>
</div>

<div id="dashboard-navbar" class="navbar">
  <ul>
<?php
	if (isset($this->pageInfo) === FALSE || $this->pageInfo === NULL) { $liClass = 'class="menu_item-selected"'; }
?>
    <li><a href="<?php echo site_url_base('/'. $this->entityClass .'/'. $this->entityIdName); ?>" <?php echo $liClass; ?>>Dashboard</a>
<?php foreach($this->pageList as $pageIdName => $pageName):
	$liClass = "";
	if ($pageIdName === $this->pageName || $pageIdName == $this->pageParentName) { $liClass = 'class="menu_item-selected"'; } ?>
    <li><a href="<?php echo site_url_base('/'. $this->entityClass .'/'. $this->entityIdName .'/'. $pageIdName); ?>" <?php echo $liClass; ?>><?php echo $pageName; ?></a>
<?php endforeach; ?>
  </ul>
</div>

<?php if (isset($this->pageInfo) && $this->pageInfo != NULL): ?>
<div id="dashboard-page">
<div class="widget">
<!--div class="widget_title"><h3><?php echo $this->pageInfo->getTitle(); ?></h3></div-->
<div class="widget_content">
<?php
	echo $this->action($this->pageInfo->getAction(), $this->pageInfo->getController(),
		$this->pageInfo->getModule(), $this->requestParams + $this->pageInfo->getParams());
?>
</div>
</div>
</div>
<?php else:
foreach ($this->widgets as $wgt):
	if ($wgt != NULL):
?>
<div class="widget">
  <div class="widget_title"><h3><?php echo $this->escape($wgt->getTitle()); ?></h3></div>
  <div class="widget_content">
<?php
	try {
		echo $this->action($wgt->getAction(), $wgt->getController(), $wgt->getModule(),
			$this->requestParams + $wgt->getParams());
	} catch (Exception $e) {
		echo $e->getMessage();
	}
?>
  </div>
</div>

<?php
	endif;
endforeach;
endif;
?>

